home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 520 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.7 KB  |  74 lines

  1. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  2. Path: ncrgw2.ncr.com!ncrhub6!daynews!falcon!news
  3. From: Dick Menninger <Dick.Menninger@DaytonOH.ATTGIS.COM>
  4. Subject: Re: Hungarian notation
  5. X-Nntp-Posting-Host: 149.25.99.44
  6. Message-ID: <DKoBrn.CHs@falcon.daytonoh.attgis.com>
  7. Sender: news@falcon.daytonoh.attgis.com (News administrative Login)
  8. Reply-To: Dick.Menninger@DaytonOH.ATTGIS.COM (mennid)
  9. Organization: AT&T Global Information Solutions
  10. X-Newsreader: DiscussIT 2.5.1.3 for MS Windows [AT&T Software Products Division]
  11. References: <4cf8hf$8fe@hopi.gate.net>
  12. Date: Thu, 4 Jan 1996 20:33:23 GMT
  13.  
  14. Imbedding type information in a name had some utility
  15. in the older C environments with the weak type checking
  16. and very poor tools (no way to click on a variable and
  17. find out the minutae of its implementation).  Even there,
  18. a price was paid that required C lexical recognizing
  19. translation (old name to new name) tools to ease evolution
  20. messes that resulted.  The imbedding of type information
  21. in variable names is really a poor substitute for good
  22. documentation and tools.
  23.  
  24. The purpose of C++ in its design
  25. and evolution has been to hide implementation while
  26. providing genuinely heavy duty compile-time type checking.
  27. A development environment must allow you to click
  28. on the variable and get the info you need.  Its name
  29. provides the concept it represents, not its currrent
  30. implementation.
  31.  
  32. I strongly suspect that people who prefer imbedding
  33. type in names are composed of people who see C++
  34. more as a better C than as what the definers of it mean.
  35.  
  36.  
  37. > ==========Michael Feathers, 1/3/96==========
  38. > jguthrie@brokersys.com wrote:
  39. > : Michael Feathers (feathers@gate.net) wrote:
  40. > : 
  41. > : : Where I work, all the truly portable code is written in terms of 
  42. > : : typedefs.  We alter the typedefs in an include file to alter data
  43. > : : sizes and performance characeristic, and our variant of Hungarian
  44. > : : uses these type names.
  45. > : 
  46. > : Why don't you just abandon the type declarations completely and use a
  47. > : prefix on the variable names to define the type?  Hey, wait a minute.
  48. > : I've seen this BEFORE!  What was it called?  FORTRAN, wasn't it?  And
  49. > : how about how those old microcomputer BASICs used suffixes
  50. to determine
  51. > : types?
  52. > : 
  53. > : The more things change, the more they stay the same.
  54. > Maybe there's a reason for that ;-)
  55. >  
  56. > : My attitude remains the same:  Any naming convention works
  57. better than
  58. > : none, but embedding the type in the name is probably a bad idea.
  59. > I really don't see why.  Hungarian is particularly useful in the
  60. > presence of polymorphism.
  61. > How can it hurt?
  62. >  
  63.  
  64.  
  65. Good Day
  66. Dick
  67. Dick.Menninger@DaytonOH.ATTGIS.COM
  68.  
  69.